﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Graphing.View;

namespace Graphing.Services
{
    /*
     * Window Opening Service
     */
    public class IWindowCloseService
    {
        #region Fields
        private IWindowOpenService windowService = GenericSingleton<IWindowOpenService>.GetInstance();
        #endregion Fields
        
        #region CloseView
        //Opens the view based on the viewName sent in
        public bool CloseView(string viewName)
        {
            switch (viewName)
            {
                case "EditPointsView":
                    windowService.EditPointsView.Close();
                    return true;

                case "GraphView":
                    if (windowService.GraphView != null && windowService.GraphView.IsEnabled)
                        windowService.GraphView.Close();
                    return true;
            }

            return false;
        }
        #endregion //CloseView


    }
}
